#include "xege.h"


extern char          title[];
extern SDL_Window*   window;
extern SDL_Event*    winEvent;
extern SDL_Renderer* winRenderer;
extern SDL_Surface*  winSurface;
extern SDL_Texture*  winTexture;
extern color_t       winBGColor;
extern color_t       winFGColor;

// private
typedef struct {
	SDL_Surface*  sPic;
	SDL_Renderer* rPic;
	SDL_Texture*  tPic;
	int w, h;
} IMAGE;

typedef IMAGE* PIMAGE;

PIMAGE newimage (int w, int h) {
	PIMAGE pic;
	pic -> sPic = SDL_CreateRGBSurface(0, w, h, 32,
	0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff);
	pic -> rPic = SDL_CreateSoftwareRenderer (pic -> sPic);
	pic -> tPic = SDL_CreateTextureFromSurface (pic -> rPic, pic -> sPic);
	pic -> w = w;
	pic -> h = h;
}